package com.py.admin.controller;

import com.py.admin.service.AdArticleVerifyService;
import com.py.model.admin.dtos.NewsAuthDto;
import com.py.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName AdArticleVerifyController
 * @Description TODO
 * @Author AXing
 * @Date 2022/11/17 16:56
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1/news")
public class AdArticleVerifyController {

    @Autowired
    private AdArticleVerifyService verifyService;

    @PostMapping("/list_vo")
    public ResponseResult list(@RequestBody NewsAuthDto dto){
        return verifyService.list(dto);
    }

    @GetMapping("/one_vo/{id}")
    public ResponseResult getDetail(@PathVariable Integer id){
        return verifyService.getDetail(id);
    }

    @PostMapping("/auth_fail")
    public ResponseResult refusePass(@RequestBody NewsAuthDto dto){
        return verifyService.refusePass(dto);
    }

    @PostMapping("/auth_pass")
    public ResponseResult pass(@RequestBody NewsAuthDto dto){
        return verifyService.pass(dto);
    }
}
